package com.hdd.fmh.common.bean;


import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;

import java.io.Serializable;

/**
 * Entity支持类
 * @author
 */
@Data
public abstract class AbstractBaseEntity extends DelFlag {

    private static final long serialVersionUID = -5398127520946862225L;

    /**
     * 实体编号（唯一标识）
     */
    @ApiModelProperty(value = "主键", name = "id")
    protected Integer id;

    public AbstractBaseEntity() {
        super();
    }

    public AbstractBaseEntity(Integer id) {
        this();
        this.id = id;
    }
    /**
     * 插入之前执行方法，子类实现
     */
    public abstract void preInsert() throws Exception;

    /**
     * 更新之前执行方法，子类实现
     */
    public abstract void preUpdate() throws Exception;
}